package com.javaweb.admin.controller;

import com.alibaba.fastjson.JSONObject;
import com.javaweb.common.utils.StringUtils;
import com.javaweb.system.entity.Menu;
import com.javaweb.system.mapper.MenuMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/test")
public class TestController {

    @Autowired
    private MenuMapper menuMapper;


    @GetMapping("/index")
    public void index() {

        String jsonList = "[{\"menuId\":29,\"parentId\":0,\"title\":\"Dashboard\",\"icon\":\"home-outlined\",\"color\":null,\"path\":\"/dashboard\",\"component\":null,\"target\":\"_self\",\"uid\":null,\"hide\":0,\"sortNumber\":0,\"authority\":null,\"menuType\":0,\"createTime\":\"2020/03/21 18:24:32\",\"updateTime\":\"2021/03/04 09:25:37\",\"deleted\":0,\"parentTitle\":null,\"children\":[{\"menuId\":31,\"parentId\":29,\"title\":\"工作台\",\"icon\":\"desktop-outlined\",\"color\":null,\"path\":\"/dashboard/workplace\",\"component\":\"/dashboard/workplace\",\"target\":\"_self\",\"uid\":null,\"hide\":0,\"sortNumber\":1,\"authority\":null,\"menuType\":0,\"createTime\":\"2020/03/21 18:24:36\",\"updateTime\":\"2020/12/29 22:32:39\",\"deleted\":0,\"parentTitle\":null,\"children\":[],\"checked\":null,\"open\":null},{\"menuId\":30,\"parentId\":29,\"title\":\"分析页\",\"icon\":\"bar-chart-outlined\",\"color\":null,\"path\":\"/dashboard/analysis\",\"component\":\"/dashboard/analysis\",\"target\":\"_self\",\"uid\":null,\"hide\":0,\"sortNumber\":2,\"authority\":null,\"menuType\":0,\"createTime\":\"2020/03/21 18:24:35\",\"updateTime\":\"2020/12/29 22:32:42\",\"deleted\":0,\"parentTitle\":null,\"children\":[],\"checked\":null,\"open\":null},{\"menuId\":32,\"parentId\":29,\"title\":\"监控页\",\"icon\":\"dashboard-outlined\",\"color\":null,\"path\":\"/dashboard/monitor\",\"component\":\"/dashboard/monitor\",\"target\":\"_self\",\"uid\":null,\"hide\":0,\"sortNumber\":3,\"authority\":null,\"menuType\":0,\"createTime\":\"2020/03/21 18:24:38\",\"updateTime\":\"2020/12/29 22:32:54\",\"deleted\":0,\"parentTitle\":null,\"children\":[],\"checked\":null,\"open\":null}],\"checked\":null,\"open\":null},{\"menuId\":1,\"parentId\":0,\"title\":\"系统管理\",\"icon\":\"setting-outlined\",\"color\":null,\"path\":\"/system\",\"component\":null,\"target\":\"_self\",\"uid\":null,\"hide\":0,\"sortNumber\":1,\"authority\":null,\"menuType\":0,\"createTime\":\"2020/02/26 12:51:23\",\"updateTime\":\"2021/03/04 09:25:43\",\"deleted\":0,\"parentTitle\":null,\"children\":[{\"menuId\":2,\"parentId\":1,\"title\":\"用户管理\",\"icon\":\"team-outlined\",\"color\":null,\"path\":\"/system/user\",\"component\":\"/system/user\",\"target\":\"_self\",\"uid\":null,\"hide\":0,\"sortNumber\":1,\"authority\":null,\"menuType\":0,\"createTime\":\"2020/02/26 12:51:55\",\"updateTime\":\"2020/12/29 22:33:13\",\"deleted\":0,\"parentTitle\":null,\"children\":[],\"checked\":null,\"open\":null},{\"menuId\":7,\"parentId\":1,\"title\":\"角色管理\",\"icon\":\"idcard-outlined\",\"color\":null,\"path\":\"/system/role\",\"component\":\"/system/role\",\"target\":\"_self\",\"uid\":null,\"hide\":0,\"sortNumber\":2,\"authority\":null,\"menuType\":0,\"createTime\":\"2020/03/13 13:29:08\",\"updateTime\":\"2020/12/29 22:33:28\",\"deleted\":0,\"parentTitle\":null,\"children\":[],\"checked\":null,\"open\":null},{\"menuId\":12,\"parentId\":1,\"title\":\"菜单管理\",\"icon\":\"bars-outlined\",\"color\":null,\"path\":\"/system/menu\",\"component\":\"/system/menu\",\"target\":\"_self\",\"uid\":null,\"hide\":0,\"sortNumber\":3,\"authority\":null,\"menuType\":0,\"createTime\":\"2020/03/21 01:07:13\",\"updateTime\":\"2020/12/29 22:33:31\",\"deleted\":0,\"parentTitle\":null,\"children\":[],\"checked\":null,\"open\":null},{\"menuId\":22,\"parentId\":1,\"title\":\"字典管理\",\"icon\":\"profile-outlined\",\"color\":null,\"path\":\"/system/dictionary\",\"component\":\"/system/dictionary\",\"target\":\"_self\",\"uid\":null,\"hide\":0,\"sortNumber\":4,\"authority\":null,\"menuType\":0,\"createTime\":\"2020/03/21 18:24:26\",\"updateTime\":\"2020/12/29 22:33:51\",\"deleted\":0,\"parentTitle\":null,\"children\":[],\"checked\":null,\"open\":null},{\"menuId\":17,\"parentId\":1,\"title\":\"机构管理\",\"icon\":\"bank-outlined\",\"color\":null,\"path\":\"/system/organization\",\"component\":\"/system/organization\",\"target\":\"_self\",\"uid\":null,\"hide\":0,\"sortNumber\":5,\"authority\":null,\"menuType\":0,\"createTime\":\"2020/03/21 18:24:20\",\"updateTime\":\"2020/12/29 22:33:44\",\"deleted\":0,\"parentTitle\":null,\"children\":[],\"checked\":null,\"open\":null},{\"menuId\":27,\"parentId\":1,\"title\":\"登录日志\",\"icon\":\"calendar-outlined\",\"color\":null,\"path\":\"/system/login-record\",\"component\":\"/system/login-record\",\"target\":\"_self\",\"uid\":null,\"hide\":0,\"sortNumber\":6,\"authority\":\"sys:login_record:view\",\"menuType\":0,\"createTime\":\"2020/03/21 18:24:33\",\"updateTime\":\"2020/12/29 22:34:06\",\"deleted\":0,\"parentTitle\":null,\"children\":[],\"checked\":null,\"open\":null},{\"menuId\":28,\"parentId\":1,\"title\":\"操作日志\",\"icon\":\"file-search-outlined\",\"color\":null,\"path\":\"/system/oper-record\",\"component\":\"/system/oper-record\",\"target\":\"_self\",\"uid\":null,\"hide\":0,\"sortNumber\":7,\"authority\":\"sys:oper_record:view\",\"menuType\":0,\"createTime\":\"2020/03/21 18:24:34\",\"updateTime\":\"2020/12/29 22:34:17\",\"deleted\":0,\"parentTitle\":null,\"children\":[],\"checked\":null,\"open\":null}],\"checked\":null,\"open\":null},{\"menuId\":33,\"parentId\":0,\"title\":\"表单页面\",\"icon\":\"file-text-outlined\",\"color\":null,\"path\":\"/form\",\"component\":null,\"target\":\"_self\",\"uid\":null,\"hide\":0,\"sortNumber\":2,\"authority\":null,\"menuType\":0,\"createTime\":\"2020/03/21 18:24:39\",\"updateTime\":\"2021/03/04 09:25:20\",\"deleted\":0,\"parentTitle\":null,\"children\":[{\"menuId\":34,\"parentId\":33,\"title\":\"基础表单\",\"icon\":\"file-done-outlined\",\"color\":null,\"path\":\"/form/basic\",\"component\":\"/form/basic\",\"target\":\"_self\",\"uid\":null,\"hide\":0,\"sortNumber\":1,\"authority\":null,\"menuType\":0,\"createTime\":\"2020/03/21 18:24:40\",\"updateTime\":\"2020/12/29 22:34:35\",\"deleted\":0,\"parentTitle\":null,\"children\":[],\"checked\":null,\"open\":null},{\"menuId\":35,\"parentId\":33,\"title\":\"复杂表单\",\"icon\":\"audit-outlined\",\"color\":null,\"path\":\"/form/advanced\",\"component\":\"/form/advanced\",\"target\":\"_self\",\"uid\":null,\"hide\":0,\"sortNumber\":2,\"authority\":null,\"menuType\":0,\"createTime\":\"2020/03/21 18:24:41\",\"updateTime\":\"2020/12/29 22:34:44\",\"deleted\":0,\"parentTitle\":null,\"children\":[],\"checked\":null,\"open\":null},{\"menuId\":36,\"parentId\":33,\"title\":\"分步表单\",\"icon\":\"one-to-one-outlined\",\"color\":null,\"path\":\"/form/step\",\"component\":\"/form/step\",\"target\":\"_self\",\"uid\":null,\"hide\":0,\"sortNumber\":3,\"authority\":null,\"menuType\":0,\"createTime\":\"2020/03/21 18:24:42\",\"updateTime\":\"2020/12/29 22:34:53\",\"deleted\":0,\"parentTitle\":null,\"children\":[],\"checked\":null,\"open\":null}],\"checked\":null,\"open\":null},{\"menuId\":37,\"parentId\":0,\"title\":\"列表页面\",\"icon\":\"table-outlined\",\"color\":null,\"path\":\"/list\",\"component\":null,\"target\":\"_self\",\"uid\":null,\"hide\":0,\"sortNumber\":3,\"authority\":null,\"menuType\":0,\"createTime\":\"2020/03/28 12:20:52\",\"updateTime\":\"2021/03/04 09:25:16\",\"deleted\":0,\"parentTitle\":null,\"children\":[{\"menuId\":38,\"parentId\":37,\"title\":\"基础列表\",\"icon\":\"ordered-list-outlined\",\"color\":null,\"path\":\"/list/basic\",\"component\":\"/list/basic\",\"target\":\"_self\",\"uid\":null,\"hide\":0,\"sortNumber\":1,\"authority\":null,\"menuType\":0,\"createTime\":\"2020/09/16 13:24:05\",\"updateTime\":\"2020/12/29 22:35:12\",\"deleted\":0,\"parentTitle\":null,\"children\":[],\"checked\":null,\"open\":null},{\"menuId\":39,\"parentId\":37,\"title\":\"复杂列表\",\"icon\":\"picLeft-outlined\",\"color\":null,\"path\":\"/list/advanced\",\"component\":\"/list/advanced\",\"target\":\"_self\",\"uid\":null,\"hide\":0,\"sortNumber\":2,\"authority\":null,\"menuType\":0,\"createTime\":\"2020/09/16 13:24:32\",\"updateTime\":\"2020/12/29 22:35:21\",\"deleted\":0,\"parentTitle\":null,\"children\":[],\"checked\":null,\"open\":null},{\"menuId\":40,\"parentId\":37,\"title\":\"卡片列表\",\"icon\":\"appstore-outlined\",\"color\":null,\"path\":\"/list/card\",\"component\":\"/list/card\",\"target\":\"_self\",\"uid\":null,\"hide\":0,\"sortNumber\":3,\"authority\":null,\"menuType\":0,\"createTime\":\"2020/09/16 13:24:57\",\"updateTime\":\"2020/12/29 22:35:30\",\"deleted\":0,\"parentTitle\":null,\"children\":[{\"menuId\":53,\"parentId\":40,\"title\":\"项目列表\",\"icon\":\"appstore-outlined\",\"color\":null,\"path\":\"/list/card/project\",\"component\":\"/list/card/project\",\"target\":\"_self\",\"uid\":null,\"hide\":0,\"sortNumber\":1,\"authority\":null,\"menuType\":0,\"createTime\":\"2020/09/16 13:30:33\",\"updateTime\":\"2020/12/30 15:15:24\",\"deleted\":0,\"parentTitle\":null,\"children\":[],\"checked\":null,\"open\":null},{\"menuId\":54,\"parentId\":40,\"title\":\"应用列表\",\"icon\":\"appstore-outlined\",\"color\":null,\"path\":\"/list/card/application\",\"component\":\"/list/card/application\",\"target\":\"_self\",\"uid\":null,\"hide\":0,\"sortNumber\":2,\"authority\":null,\"menuType\":0,\"createTime\":\"2020/09/16 13:30:57\",\"updateTime\":\"2020/12/30 15:15:25\",\"deleted\":0,\"parentTitle\":null,\"children\":[],\"checked\":null,\"open\":null},{\"menuId\":55,\"parentId\":40,\"title\":\"文章列表\",\"icon\":\"appstore-outlined\",\"color\":null,\"path\":\"/list/card/article\",\"component\":\"/list/card/article\",\"target\":\"_self\",\"uid\":null,\"hide\":0,\"sortNumber\":3,\"authority\":null,\"menuType\":0,\"createTime\":\"2020/09/16 13:31:18\",\"updateTime\":\"2020/12/30 15:15:26\",\"deleted\":0,\"parentTitle\":null,\"children\":[],\"checked\":null,\"open\":null}],\"checked\":null,\"open\":null}],\"checked\":null,\"open\":null},{\"menuId\":41,\"parentId\":0,\"title\":\"结果页面\",\"icon\":\"check-circle-outlined\",\"color\":null,\"path\":\"/result\",\"component\":null,\"target\":\"_self\",\"uid\":null,\"hide\":0,\"sortNumber\":4,\"authority\":null,\"menuType\":0,\"createTime\":\"2020/09/16 13:25:15\",\"updateTime\":\"2021/03/04 09:25:11\",\"deleted\":0,\"parentTitle\":null,\"children\":[{\"menuId\":42,\"parentId\":41,\"title\":\"成功页\",\"icon\":\"check-circle-outlined\",\"color\":null,\"path\":\"/result/success\",\"component\":\"/result/success\",\"target\":\"_self\",\"uid\":null,\"hide\":0,\"sortNumber\":1,\"authority\":null,\"menuType\":0,\"createTime\":\"2020/09/16 13:25:32\",\"updateTime\":\"2020/12/29 22:35:58\",\"deleted\":0,\"parentTitle\":null,\"children\":[],\"checked\":null,\"open\":null},{\"menuId\":43,\"parentId\":41,\"title\":\"失败页\",\"icon\":\"close-circle-outlined\",\"color\":null,\"path\":\"/result/fail\",\"component\":\"/result/fail\",\"target\":\"_self\",\"uid\":null,\"hide\":0,\"sortNumber\":2,\"authority\":null,\"menuType\":0,\"createTime\":\"2020/09/16 13:25:51\",\"updateTime\":\"2020/12/29 22:36:07\",\"deleted\":0,\"parentTitle\":null,\"children\":[],\"checked\":null,\"open\":null}],\"checked\":null,\"open\":null},{\"menuId\":44,\"parentId\":0,\"title\":\"异常页面\",\"icon\":\"warning-outlined\",\"color\":null,\"path\":\"/exception\",\"component\":null,\"target\":\"_self\",\"uid\":null,\"hide\":0,\"sortNumber\":5,\"authority\":null,\"menuType\":0,\"createTime\":\"2020/09/16 13:26:18\",\"updateTime\":\"2021/03/04 09:25:06\",\"deleted\":0,\"parentTitle\":null,\"children\":[{\"menuId\":45,\"parentId\":44,\"title\":\"403\",\"icon\":\"exclamation-circle-outlined\",\"color\":null,\"path\":\"/exception/403\",\"component\":\"/exception/403\",\"target\":\"_self\",\"uid\":null,\"hide\":0,\"sortNumber\":1,\"authority\":null,\"menuType\":0,\"createTime\":\"2020/09/16 13:26:37\",\"updateTime\":\"2021/02/05 00:08:47\",\"deleted\":0,\"parentTitle\":null,\"children\":[],\"checked\":null,\"open\":null},{\"menuId\":46,\"parentId\":44,\"title\":\"404\",\"icon\":\"question-circle-outlined\",\"color\":null,\"path\":\"/exception/404\",\"component\":\"/exception/404\",\"target\":\"_self\",\"uid\":null,\"hide\":0,\"sortNumber\":2,\"authority\":null,\"menuType\":0,\"createTime\":\"2020/09/16 13:27:01\",\"updateTime\":\"2021/02/05 00:08:49\",\"deleted\":0,\"parentTitle\":null,\"children\":[],\"checked\":null,\"open\":null},{\"menuId\":47,\"parentId\":44,\"title\":\"500\",\"icon\":\"close-circle-outlined\",\"color\":null,\"path\":\"/exception/500\",\"component\":\"/exception/500\",\"target\":\"_self\",\"uid\":null,\"hide\":0,\"sortNumber\":3,\"authority\":null,\"menuType\":0,\"createTime\":\"2020/09/16 13:27:32\",\"updateTime\":\"2021/02/05 00:08:51\",\"deleted\":0,\"parentTitle\":null,\"children\":[],\"checked\":null,\"open\":null}],\"checked\":null,\"open\":null},{\"menuId\":48,\"parentId\":0,\"title\":\"个人中心\",\"icon\":\"control-outlined\",\"color\":null,\"path\":\"/user\",\"component\":null,\"target\":\"_self\",\"uid\":null,\"hide\":0,\"sortNumber\":6,\"authority\":null,\"menuType\":0,\"createTime\":\"2020/09/16 13:28:08\",\"updateTime\":\"2021/03/04 09:24:57\",\"deleted\":0,\"parentTitle\":null,\"children\":[{\"menuId\":49,\"parentId\":48,\"title\":\"个人资料\",\"icon\":\"user-outlined\",\"color\":null,\"path\":\"/user/info\",\"component\":\"/user/info\",\"target\":\"_self\",\"uid\":null,\"hide\":0,\"sortNumber\":1,\"authority\":null,\"menuType\":0,\"createTime\":\"2020/09/16 13:28:29\",\"updateTime\":\"2020/12/29 22:37:04\",\"deleted\":0,\"parentTitle\":null,\"children\":[],\"checked\":null,\"open\":null},{\"menuId\":50,\"parentId\":48,\"title\":\"我的消息\",\"icon\":\"sound-outlined\",\"color\":null,\"path\":\"/user/message\",\"component\":\"/user/message\",\"target\":\"_self\",\"uid\":null,\"hide\":0,\"sortNumber\":2,\"authority\":null,\"menuType\":0,\"createTime\":\"2020/09/16 13:28:46\",\"updateTime\":\"2020/12/29 22:37:15\",\"deleted\":0,\"parentTitle\":null,\"children\":[],\"checked\":null,\"open\":null}],\"checked\":null,\"open\":null},{\"menuId\":51,\"parentId\":0,\"title\":\"扩展组件\",\"icon\":\"appstore-add-outlined\",\"color\":null,\"path\":\"/extension\",\"component\":null,\"target\":\"_self\",\"uid\":null,\"hide\":0,\"sortNumber\":7,\"authority\":null,\"menuType\":0,\"createTime\":\"2020/09/16 13:29:38\",\"updateTime\":\"2021/03/04 09:24:48\",\"deleted\":0,\"parentTitle\":null,\"children\":[{\"menuId\":73,\"parentId\":51,\"title\":\"文件列表\",\"icon\":\"folder-outlined\",\"color\":null,\"path\":\"/extension/file\",\"component\":\"/extension/file\",\"target\":\"_self\",\"uid\":null,\"hide\":0,\"sortNumber\":1,\"authority\":null,\"menuType\":0,\"createTime\":\"2020/09/26 16:19:50\",\"updateTime\":\"2020/12/30 13:41:11\",\"deleted\":0,\"parentTitle\":null,\"children\":[],\"checked\":null,\"open\":null},{\"menuId\":59,\"parentId\":51,\"title\":\"打印插件\",\"icon\":\"printer-outlined\",\"color\":null,\"path\":\"/extension/printer\",\"component\":\"/extension/printer\",\"target\":\"_self\",\"uid\":null,\"hide\":0,\"sortNumber\":2,\"authority\":null,\"menuType\":0,\"createTime\":\"2020/09/16 13:32:39\",\"updateTime\":\"2020/12/30 13:41:03\",\"deleted\":0,\"parentTitle\":null,\"children\":[],\"checked\":null,\"open\":null},{\"menuId\":60,\"parentId\":51,\"title\":\"excel插件\",\"icon\":\"table-outlined\",\"color\":null,\"path\":\"/extension/excel\",\"component\":\"/extension/excel\",\"target\":\"_self\",\"uid\":null,\"hide\":0,\"sortNumber\":3,\"authority\":null,\"menuType\":0,\"createTime\":\"2020/09/16 13:32:59\",\"updateTime\":\"2020/12/30 13:41:00\",\"deleted\":0,\"parentTitle\":null,\"children\":[],\"checked\":null,\"open\":null},{\"menuId\":61,\"parentId\":51,\"title\":\"拖拽排序\",\"icon\":\"drag-outlined\",\"color\":null,\"path\":\"/extension/dragsort\",\"component\":\"/extension/dragsort\",\"target\":\"_self\",\"uid\":null,\"hide\":0,\"sortNumber\":4,\"authority\":null,\"menuType\":0,\"createTime\":\"2020/09/16 13:33:18\",\"updateTime\":\"2020/12/30 13:40:57\",\"deleted\":0,\"parentTitle\":null,\"children\":[],\"checked\":null,\"open\":null},{\"menuId\":62,\"parentId\":51,\"title\":\"地图组件\",\"icon\":\"environment-outlined\",\"color\":null,\"path\":\"/extension/map\",\"component\":\"/extension/map\",\"target\":\"_self\",\"uid\":null,\"hide\":0,\"sortNumber\":5,\"authority\":null,\"menuType\":0,\"createTime\":\"2020/09/16 13:33:41\",\"updateTime\":\"2020/12/30 13:40:55\",\"deleted\":0,\"parentTitle\":null,\"children\":[],\"checked\":null,\"open\":null},{\"menuId\":63,\"parentId\":51,\"title\":\"视频播放\",\"icon\":\"youtube-outlined\",\"color\":null,\"path\":\"/extension/player\",\"component\":\"/extension/player\",\"target\":\"_self\",\"uid\":null,\"hide\":0,\"sortNumber\":6,\"authority\":null,\"menuType\":0,\"createTime\":\"2020/09/16 13:33:56\",\"updateTime\":\"2021/03/09 00:02:14\",\"deleted\":0,\"parentTitle\":null,\"children\":[],\"checked\":null,\"open\":null},{\"menuId\":64,\"parentId\":51,\"title\":\"富文本框\",\"icon\":\"font-size-outlined\",\"color\":null,\"path\":\"/extension/editor\",\"component\":\"/extension/editor\",\"target\":\"_self\",\"uid\":null,\"hide\":0,\"sortNumber\":7,\"authority\":null,\"menuType\":0,\"createTime\":\"2020/09/16 13:34:14\",\"updateTime\":\"2021/03/09 16:49:30\",\"deleted\":0,\"parentTitle\":null,\"children\":[],\"checked\":null,\"open\":null},{\"menuId\":57,\"parentId\":51,\"title\":\"更多组件\",\"icon\":\"ellipsis-outlined\",\"color\":null,\"path\":\"/extension/more\",\"component\":\"/extension/more\",\"target\":\"_self\",\"uid\":null,\"hide\":0,\"sortNumber\":8,\"authority\":null,\"menuType\":0,\"createTime\":\"2020/09/16 13:32:04\",\"updateTime\":\"2020/12/30 13:40:46\",\"deleted\":0,\"parentTitle\":null,\"children\":[],\"checked\":null,\"open\":null}],\"checked\":null,\"open\":null},{\"menuId\":71,\"parentId\":0,\"title\":\"经典实例\",\"icon\":\"compass-outlined\",\"color\":null,\"path\":\"/example\",\"component\":null,\"target\":\"_self\",\"uid\":null,\"hide\":0,\"sortNumber\":9,\"authority\":null,\"menuType\":0,\"createTime\":\"2020/09/21 17:09:54\",\"updateTime\":\"2021/03/04 09:24:04\",\"deleted\":0,\"parentTitle\":null,\"children\":[{\"menuId\":72,\"parentId\":71,\"title\":\"案卷调整\",\"icon\":\"interaction-outlined\",\"color\":null,\"path\":\"/example/document\",\"component\":\"/example/document\",\"target\":\"_self\",\"uid\":null,\"hide\":0,\"sortNumber\":1,\"authority\":null,\"menuType\":0,\"createTime\":\"2020/09/21 17:13:14\",\"updateTime\":\"2020/12/29 22:39:44\",\"deleted\":0,\"parentTitle\":null,\"children\":[],\"checked\":null,\"open\":null},{\"menuId\":74,\"parentId\":71,\"title\":\"批量选择\",\"icon\":\"check-square-outlined\",\"color\":null,\"path\":\"/example/choose\",\"component\":\"/example/choose\",\"target\":\"_self\",\"uid\":null,\"hide\":0,\"sortNumber\":2,\"authority\":null,\"menuType\":0,\"createTime\":\"2020/09/30 14:08:22\",\"updateTime\":\"2020/12/29 22:39:54\",\"deleted\":0,\"parentTitle\":null,\"children\":[],\"checked\":null,\"open\":null},{\"menuId\":76,\"parentId\":71,\"title\":\"内嵌页面\",\"icon\":\"youtube-outlined\",\"color\":null,\"path\":\"/example/iqiyi\",\"component\":\"https://www.iqiyi.com\",\"target\":\"_self\",\"uid\":null,\"hide\":0,\"sortNumber\":3,\"authority\":null,\"menuType\":0,\"createTime\":\"2021/03/02 11:05:31\",\"updateTime\":\"2021/03/09 00:03:29\",\"deleted\":0,\"parentTitle\":null,\"children\":[],\"checked\":null,\"open\":null}],\"checked\":null,\"open\":null},{\"menuId\":75,\"parentId\":0,\"title\":\"获取授权\",\"icon\":\"sketch-outlined\",\"color\":null,\"path\":\"https://eleadmin.com/goods/9\",\"component\":null,\"target\":\"_blank\",\"uid\":null,\"hide\":0,\"sortNumber\":10,\"authority\":null,\"menuType\":0,\"createTime\":\"2020/10/06 23:02:41\",\"updateTime\":\"2020/12/29 22:40:03\",\"deleted\":0,\"parentTitle\":null,\"children\":[],\"checked\":null,\"open\":null}]";
        List list = JSONObject.parseObject(jsonList, List.class);
        System.out.println(list);
        for (Object o : list) {
            Menu menu = new Menu();
            menu.setSort(Integer.valueOf(((JSONObject) o).get("sortNumber").toString()));
            menu.setIcon(((JSONObject) o).get("icon").toString());
            menu.setTitle(((JSONObject) o).get("title").toString());
            menu.setPid(0);
            menu.setTarget(((JSONObject) o).get("target").toString());
            menu.setPath(((JSONObject) o).get("path").toString());
            menu.setComponent(StringUtils.isNull(((JSONObject) o).get("component")) ? "" : ((JSONObject) o).get("component").toString());
            menu.setType(Integer.valueOf(((JSONObject) o).get("menuType").toString()));
            menuMapper.insert(menu);

            List list1 = JSONObject.parseObject(((JSONObject) o).get("children").toString(), List.class);
            if (!list1.isEmpty()) {
                for (Object o1 : list1) {
                    Menu menu2 = new Menu();
                    menu2.setSort(Integer.valueOf(((JSONObject) o1).get("sortNumber").toString()));
                    menu2.setIcon(((JSONObject) o1).get("icon").toString());
                    menu2.setTitle(((JSONObject) o1).get("title").toString());
                    menu2.setPid(menu.getId());
                    menu2.setTarget(((JSONObject) o1).get("target").toString());
                    menu2.setPath(((JSONObject) o1).get("path").toString());
                    menu2.setComponent(StringUtils.isNull(((JSONObject) o1).get("component")) ? "" : ((JSONObject) o1).get("component").toString());
                    menu2.setType(Integer.valueOf(((JSONObject) o1).get("menuType").toString()));
                    menuMapper.insert(menu2);

                    List list2 = JSONObject.parseObject(((JSONObject) o1).get("children").toString(), List.class);
                    if (!list2.isEmpty()) {
                        for (Object o2 : list2) {
                            Menu menu1 = new Menu();
                            menu1.setSort(Integer.valueOf(((JSONObject) o2).get("sortNumber").toString()));
                            menu1.setIcon(((JSONObject) o2).get("icon").toString());
                            menu1.setTitle(((JSONObject) o2).get("title").toString());
                            menu1.setPid(menu2.getId());
                            menu1.setTarget(((JSONObject) o2).get("target").toString());
                            menu1.setPath(((JSONObject) o2).get("path").toString());
                            menu1.setComponent(StringUtils.isNull(((JSONObject) o2).get("component")) ? "" : ((JSONObject) o2).get("component").toString());
                            menu1.setType(Integer.valueOf(((JSONObject) o2).get("menuType").toString()));
                            menuMapper.insert(menu1);
                        }
                    }
                }
            }

        }

        System.out.println("END");

    }

}
